﻿using System;
using System.Collections.Generic;
using System.Text;

namespace TestDataCreator
{
	public interface ILicenseNumberTester
	{
		/// <summary>
		/// Creates a data set of image paths and blank lisence plate numbers from all images located in the specified folder (and subfolders).
		/// </summary>
		/// <param name="path">A full path to a folder with images or videos</param>
		/// <param name="includeSubfolders">Specifies whether to include files in subfolders</param>
		/// <returns>True if successful</returns>
		bool CreateDataFromFolder(string path, bool includeSubfolders, bool firstRun);

		/// <summary>
		/// Writes the data set into a .CSV file
		/// </summary>
		/// <param name="target">A full path of the target file</param>
		/// <param name="copyFiles">Specifies whether to copy all files to the same folder where the .CSV file is saved</param>
		/// <returns>True if successful</returns>
		bool WriteData(string target, bool copyFiles);

		/// <summary>
		/// Read the data set from a specified file
		/// </summary>
		/// <param name="path">A full path to a source file</param>
		/// <returns>True if successful</returns>
		bool GetDataFromFile(string path);

		/// <summary>
		/// Gets a license plate number from an image/video with specified number in a data set
		/// </summary>
		/// <param name="num">Image/video number in a data set</param>
		/// <returns>License plate number in an image/video</returns>
		string GetLicenseNumber(int num);

		/// <summary>
		/// Gets a license plate number from an image/video with specified path
		/// </summary>
		/// <param name="path">Full path to an image/video from which to return a license plate number</param>
		/// <returns>License plate number in an image/video</returns>
		string GetLicenseNumber(string path);

		/// <summary>
		/// Sets a new license number for an image/video with a specified number in a data set
		/// </summary>
		/// <param name="num">Number of an image/video in a data set</param>
		/// <param name="newValue">New value of a license plate number</param>
		void EditLicenseNumber(int num, string newValue);

		/// <summary>
		/// Sets a new license number for an image/video with a specified number in a data set
		/// </summary>
		/// <param name="path">Full path to an image/video</param>
		/// <param name="newValue">New value of a license plate number</param>
		void EditLicenseNumber(string path, string newValue);

		/// <summary>
		/// Sets a new path for an image/video with a specified number in a data set
		/// </summary>
		/// <param name="num">Number of an image/video in a data set</param>
		/// <param name="newPath">New path to an image/video</param>
		void EditPath(int num, string newPath);

		/// <summary>
		/// Sets a new path for an image/video provided an old path value is given
		/// </summary>
		/// <param name="oldPath">Old image/video path to be changed</param>
		/// <param name="newPath">New path to an image/video</param>
		void EditPath(string oldPath, string newPath);

		/// <summary>
		/// Compares a provided data set of images/videos and license plate numbers with the reference data set
		/// /// </summary>
		/// <param name="results">A data set of images/videos and recognized license plate numbers</param>
		/// <returns>A percentage of correctly recognized license plate numbers</returns>
		float BatchTest(List<DataItem> results);

		/// <summary>
		/// Compares a provided data set of images/videos and license plate numbers with the reference data set
		/// </summary>
		/// <param name="paths">A list of image/video paths</param>
		/// <param name="licenseNumbers">A list of recognized license plate numbers</param>
		/// <returns>A percentage of correctly recognized license plate numbers</returns>
		float BatchTest(List<string> paths, List<string> licenseNumbers);

		/// <summary>
		/// Compares a provided DataItem object that contains a recognized license plate number with a reference value
		/// </summary>
		/// <param name="result">A DataItem object that contains a recognized license plate number</param>
		/// <returns>The result of comparison in a form of a bool value</returns>
		bool SingleTest(DataItem result);

		/// <summary>
		/// Returns a copy of a reference data set
		/// </summary>
		/// <returns>A copy of a reference data set</returns>
		List<DataItem> Clone();

		/// <summary>
		/// Checks if a Data item with specified number is a video
		/// </summary>
		/// <param name="num">Number of an item in a data set</param>
		/// <returns>True if an item is a video and False if it is an image</returns>
		bool IsVideo(int num);

		/// <summary>
		/// Checks if a Data item with specified number is a video
		/// </summary>
		/// <param name="path">Path to an data item</param>
		/// <returns>True if an item is a video and False if it is an image</returns>
		bool IsVideo(string path);

		/// <summary>
		/// Overwrites the images/videos data set with a new one provided as an argument
		/// </summary>
		/// <param name="newData">A new images/videos data set</param>
		void SetData(List<DataItem> newData);

		/// <summary>
		/// Allows to retrieve a list of images/videos as a separate list
		/// </summary>
		/// <param name="namesOnly">Return only file names instead of full paths?</param>
		/// <returns>A list of images/videos paths</returns>
		List<string> GetPathList(bool namesOnly);

		/// <summary>
		/// Retrieves a list of all license plate numbers
		/// </summary>
		/// <returns>A list of license plate numbers</returns>
		List<string> GetLicenseNumbers();
	}
}
